package com.hsxxherp.ation.common.error;

import com.google.common.base.Objects;
import com.hsxxherp.ation.common.utils.json.AtionGsonBuilder;

import java.io.Serializable;

/**
 * openapi模块错误，对外处理
 */
public class AtionOpenApiError implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 错误代码
     */
    private String error;

    /**
     * 错误消息
     */
    private String message;

    /**
     * 错误记录追踪码，日志平台使用，用于后期追踪错误信息使用
     */
    private String rid;

    public String getError() {
        return this.error;
    }

    private String getMessage() {
        return this.message;
    }

    private String getRid() {
        return this.rid;
    }

    @Override
    public String toString() {
        return AtionGsonBuilder.create().toJson(this);
    }

    @Override
    public boolean equals(Object object) {
        return Objects.equal(this, object);
    }


}
